<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title> Administracion de informes de paises</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        {% load staticfiles %}
        <link rel="stylesheet" href="{% static "css/spacelab.css" %}">
        {% load staticfiles %}
        <link rel="stylesheet" href="{% static "css/responsive.css" %}">
        {% load staticfiles %}
        <link rel="stylesheet" href="{% static "css/misestilos.css" %}">
        {% load staticfiles %}
        <link rel="stylesheet" href="{% static "css/menu_jquery.css" %}">

        {% load staticfiles %} <script type="text/javascript" src="{% static "js/jquery.js" %}"></script>
        {% load staticfiles %} <script type="text/javascript" src="{% static "js/menu_jquery.js" %}"></script>
    </head>
    <body>

        {% include "topmenu.html" %} <!-- Top menu -->

        <div class="container">
            <div class="row-fluid">

                {% include "sidebar.html" %} <!-- Side bar -->

                <div class="span9">
                    <div class="page-header">
                        <h2> Administración de informes de países de su región</h2>
                    </div>

                    <div class="row-fluid">
                        {% if message %}
                        <div class="alert alert-success">
                            {{ message }}
                        </div>
                        {% endif %}

                        <div class="span12">
                            <p>
                                Lista de paises de su región
                            </p>
                            <table cellpadding="10" border="0" width="100%" class="table table-striped">
                                <tr>
                                    <th>País</th>
                                    <th colspan="2">Período</th>
                                    <th colspan="2">Opciones</th>
                                    <th> Informes anteriores </th>
                                </tr>
                                {% for codigo, nombre , informe , mas_de_uno in lista_sinc_paises %}
                                {% if informe.id == NULL %}
                                <tr>
                                    <td align="center" >{{ nombre }}</td>
                                    <td align="center" colspan="2"> No posee informes </td>
                                    <td align="center" colspan="3"><a class="btn btn-primary" href=/plataforma/carga_formulario_pais/{{codigo}}> Agregar nuevo</a></td>
                                </tr>
                                {% else %}
                                <tr>
                                    <td align="center" >{{ nombre }}</td>
                                    <td align="center" >{{ informe.fecha_inicio | date:" d/m/Y" }} </td>
                                    <td align="center" >{{ informe.fecha_fin | date:" d/m/Y"}} </td>
                                    <td align="center" colspan="2"><a class="btn btn-primary" href=/plataforma/ver_informes_pais/{{informe.id}}>Ver</a> &nbsp; &nbsp; &nbsp; <a class="btn btn-primary" href=/plataforma/carga_formulario_pais/{{informe.pais}}/{{informe.id}}>Editar</a> &nbsp; &nbsp; &nbsp; <a class="btn btn-primary" href=/plataforma/carga_formulario_pais/{{codigo}}> Agregar nuevo</a></td>
                                    {% if mas_de_uno == True %}
                                    <td align="center" ><a class="btn btn-primary" href=/plataforma/ver_informes_pais_anteriores/{{codigo}}> Ver informes previos</a></td>
                                    {% else %}
                                    <td align="center" > Sin informes previos</td>
                                    {% endif %}

                                </tr>
                                {% endif %}
                                {% endfor %}
                            </table>
                        </div>
                    </div>
                </div>
            </div><!-- row fluid -->

            {% include "footer.html" %} <!-- Footer -->
        </div>
        <!-- container -->

        <!-- JS files -->
        {% load staticfiles %} <script type="text/javascript" src="{% static "js/bootstrap.js" %}"></script>
        {% load staticfiles %} <script type="text/javascript" src="{% static "js/bootstrap-formhelpers-countries.js" %}"></script>
        {% load staticfiles %} <script type="text/javascript" src="{% static "js/bootstrap-formhelpers-countries-US.js" %}"></script>

    </body>
</html>